<div class="wrapper wrapper-content fadeInRight" ng-controller="orderCtr">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>订单列表</h5>
                </div>
                <div class="ibox-content">
                    <div class="row">
                        <div class="col-sm-10 pull-left">
                            <form class="form-inline">
                                <select class="form-control" ng-model="data.search.type">
                                    <option value="">请选择项目</option>
                                    <option value="1">年报</option>
                                    <option value="2">注销</option>
                                    <option value="3">公司注册</option>
                                    <option value="4">公司变更</option>
                                </select>
                                <select class="form-control" ng-model="data.search.status">
                                    <option value="">请选择类型</option>
                                    <option value="2">待处理</option>
                                    <option value="3">成功</option>
                                    <option value="4">失败</option>
                                </select>
                                <select class="form-control" ng-model="data.search.pay_status">
                                    <option value="">请选择支付状态</option>
                                    <option value="1">未支付</option>
                                    <option value="2">已支付</option>
                                </select>
                                <input class="form-control" ng-model="data.search.keyword" placeholder="主体名称|法人姓名">
                                <button class="btn btn-primary" ng-click="getList(1)">搜索</button>
                                <!--<button class="btn btn-success" access="OrderExport" ng-click="export()">导出</button>-->
                            </form>
                        </div>
                    </div>
                    <table class="table table-bordered table-hover text-center">
                        <thead>
                        <tr>
                            <td>序号</td>
                            <td>项目</td>
                            <td>主体名称</td>
                            <td>法人姓名</td>
                            <td>身份证号</td>
                            <td>手机号码</td>
                            <td>支付金额</td>
                            <td>支付状态</td>
                            <td>状态</td>
                            <td>创建时间</td>
                            <td>操作</td>
                        </tr>
                        </thead>
                        <tbody>
                        <tr ng-repeat="item in data.list">
                            <td>{{getItemIndex($index, data.search.page, data.search.pageSize)}}</td>
                            <td>
                                <span class="btn btn-xs btn-success" ng-if="item.type==1">年报</span>
                                <span class="btn btn-xs btn-warning" ng-if="item.type==2">注销</span>
                                <span class="btn btn-xs btn-primary" ng-if="item.type==3">公司注册</span>
                                <span class="btn btn-xs btn-danger" ng-if="item.type==4">公司变更</span>
                            </td>
                            <td>{{item.title}}</td>
                            <td>{{item.name}}</td>
                            <td>{{item.idcard}}</td>
                            <td>{{item.mobile}}</td>
                            <td>{{item.price}}</td>
                            <td>
                                <span class="btn btn-xs btn-warning" ng-if="!item.pay_date">未支付</span>
                                <span class="btn btn-xs btn-success" ng-if="item.pay_date">
                                    已支付<br/>{{item.pay_date}}
                                </span>
                            </td>
                            <td>
                                <span class="btn btn-xs btn-warning" ng-if="item.status<=2">待处理</span>
                                <span class="btn btn-xs btn-success" ng-if="item.status==3">成功</span>
                                <span class="btn btn-xs btn-danger" ng-if="item.status==4">失败</span>
                            </td>
                            <td>{{item.create_time}}</td>
                            <td>
                                <span class="btn btn-xs btn-primary" access="OrderSave" ng-click="edit(item)">编辑</span>
                                <span class="btn btn-xs btn-success" ng-if="item.status!=3" access="OrderSuccess" ng-click="success(item)">成功</span>
                                <span class="btn btn-xs btn-warning" ng-if="item.status!=4" access="OrderError" ng-click="error(item)">失败</span>

                                <span class="btn btn-xs btn-danger" access="OrderDelete" ng-click="del(item)">删除</span>
                                <span class="btn btn-xs btn-success" ng-if="item.zheng" ng-click="showIcCard(item)">查看证件</span>
                            </td>
                        </tr>
                        <tr no-data="data.list"></tr>
                        </tbody>
                    </table>
                    <div admin-page="data.pages" curr-page="data.search.page" datas-count="data.count" callback="getList"></div>
                </div>
            </div>
        </div>
    </div>

    <div class="modal fade" id="myModal" tabindex="1" role="dialog" data-backdrop="static">
        <div class="modal-dialog" role="document" style="width: 1200px">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="close"><span
                            aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="myModalLabel">编辑</h4>
                </div>
                <div class="modal-body">
                    <form class="form-horizontal" id="editForm">

                        <div class="form-group">
                            <label class="col-sm-2 control-label">主体名称</label>
                            <div class="col-sm-9">
                                <input class="form-control" type="text" ng-model="data.edit.title" name="title" required>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">法人姓名</label>
                            <div class="col-sm-9">
                                <input class="form-control" type="text" ng-model="data.edit.name" name="name" required>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">身份证号</label>
                            <div class="col-sm-9">
                                <input class="form-control" type="text" ng-model="data.edit.idcard" name="idcard" required>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">手机号码</label>
                            <div class="col-sm-9">
                                <input class="form-control" type="text" ng-model="data.edit.mobile" name="mobile" required>
                            </div>
                        </div>

                    </form>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-defualt" data-dismiss="modal">取消</button>
                    <button type="button" class="btn btn-primary" ng-click="commit()" access="OrderSave">保存</button>
                </div>
            </div>
        </div>
    </div>
    <div class="modal fade" id="idcardModal" tabindex="1" role="dialog" data-backdrop="static">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="myIdcardModalLabel">身份证</h4>
                </div>
                <div class="modal-body">
                    <div class="row">
                        <div class="col-sm-6">
                            正面：
                            <a target="_blank" href="{{data.edit.zheng}}"><img ng-src="{{data.edit.zheng}}" style="width: 100%"></a>
                        </div>
                        <div class="col-sm-6">
                            反面：
                            <a target="_blank" href="{{data.edit.fan}}"><img ng-src="{{data.edit.fan}}" style="width: 100%"></a>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-defualt" data-dismiss="modal">取消</button>
                </div>
            </div>
        </div>
    </div>
</div>